Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added rqt_console to devroute.yaml #587

Merged

Conversation

asamluka
Copy link
Collaborator

@asamluka asamluka commented Dec 18, 2024

Description

Added command to open up the rqt console when compose up is executed on the devroute.yaml.

Fixes #586

Type of change

  • New feature (non-breaking change which adds functionality)

Does this PR introduce a breaking change?

No

Most important changes

docker-compose.devroute.yaml

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • New and existing unit tests pass locally with my changes (might be obsolete with CI later on)

Summary by CodeRabbit

  • New Features
    • Introduced background execution of rqt_console alongside the leaderboard evaluator script for improved functionality.

@asamluka asamluka linked an issue Dec 18, 2024 that may be closed by this pull request
2 tasks
Copy link
Contributor

coderabbitai bot commented Dec 18, 2024

Walkthrough

The pull request modifies the docker-compose.devroute.yaml file to include the execution of rqt_console as a background process during the agent service startup. This change aims to ensure that the ROS (Robot Operating System) console is automatically launched when the development route environment is composed up, providing immediate access to the ROS console for monitoring and debugging purposes.

Changes

File Change Summary
build/docker-compose.devroute.yaml Added rqt_console & to the command sequence, running it in the background before the existing Python script execution

Assessment against linked issues

Objective Addressed Explanation
Start rqt_console on compose up [#586]

Poem

🐰 A rabbit's docker dance begins,
RQT console springs to life with grins,
Background process, silent and light,
Debugging made clear, a developer's delight!
Compose up, and watch the magic unfold 🤖


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@asamluka asamluka added the system System Engineering label Dec 18, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
build/docker-compose.devroute.yaml (2)

15-15: LGTM! Consider adding error handling for rqt_console.

The addition of rqt_console as a background process is correctly implemented. However, consider adding error handling to ensure the service continues even if rqt_console fails to start.

-    command: bash -c "sleep 10 && sudo chown -R ${USER_UID}:${USER_GID} ../ && sudo chmod -R a+w ../ && (rqt_console &) && python3 /opt/leaderboard/leaderboard/leaderboard_evaluator.py --debug=0 --routes=$${ROUTE} --agent=/workspace/code/agent/src/agent/agent.py --host=$${CARLA_SIM_HOST} --track=MAP"
+    command: bash -c "sleep 10 && sudo chown -R ${USER_UID}:${USER_GID} ../ && sudo chmod -R a+w ../ && (rqt_console || echo 'Warning: rqt_console failed to start' >&2) & python3 /opt/leaderboard/leaderboard/leaderboard_evaluator.py --debug=0 --routes=$${ROUTE} --agent=/workspace/code/agent/src/agent/agent.py --host=$${CARLA_SIM_HOST} --track=MAP"

15-15: Consider refactoring the complex command into a startup script.

The command is becoming long and complex, which could make it harder to maintain. Consider moving it to a dedicated startup script.

Example structure:

+    # Create a new file: build/scripts/agent-startup.sh
+    #!/bin/bash
+    set -e
+    
+    # Wait for dependencies
+    sleep 10
+    
+    # Set permissions
+    sudo chown -R ${USER_UID}:${USER_GID} ../
+    sudo chmod -R a+w ../
+    
+    # Start rqt_console
+    (rqt_console || echo 'Warning: rqt_console failed to start' >&2) &
+    
+    # Start leaderboard evaluator
+    exec python3 /opt/leaderboard/leaderboard/leaderboard_evaluator.py \
+      --debug=0 \
+      --routes=${ROUTE} \
+      --agent=/workspace/code/agent/src/agent/agent.py \
+      --host=${CARLA_SIM_HOST} \
+      --track=MAP

Then in docker-compose:

-    command: bash -c "sleep 10 && sudo chown -R ${USER_UID}:${USER_GID} ../ && sudo chmod -R a+w ../ && (rqt_console &) && python3 /opt/leaderboard/leaderboard/leaderboard_evaluator.py --debug=0 --routes=$${ROUTE} --agent=/workspace/code/agent/src/agent/agent.py --host=$${CARLA_SIM_HOST} --track=MAP"
+    command: /workspace/build/scripts/agent-startup.sh
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eabc86e and 9ba951b.

📒 Files selected for processing (1)
  • build/docker-compose.devroute.yaml (1 hunks)
🔇 Additional comments (1)
build/docker-compose.devroute.yaml (1)

15-15: Verify if the sleep duration is sufficient.

The command includes a 10-second sleep, presumably waiting for dependencies. Let's verify if this duration is adequate.

✅ Verification successful

10-second sleep appears to be a consistent pattern across distributed setups

The verification shows that the 10-second sleep duration is consistently used across multiple docker-compose configurations:

  • docker-compose.leaderboard.yaml
  • docker-compose.leaderboard-distributed.yaml
  • docker-compose.devroute.yaml
  • docker-compose.devroute-distributed.yaml

All these files use the same sleep duration for similar initialization tasks (file permissions setup and ROS-related operations). Since this pattern has been established across different deployment scenarios and there are no documented startup timing issues in the codebase, the 10-second duration appears to be sufficient.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any timing-related configurations or sleep commands in other compose files
echo "Checking referenced compose files for timing configurations..."
rg -A 2 "sleep|delay|timeout" roscore_service.yaml docker-compose.carla-simulator.yaml

echo "Checking if there are any documented startup requirements..."
fd -g "README*" -X rg -i "startup|boot|wait|timing"

Length of output: 545


Script:

#!/bin/bash
# Let's first find the correct docker-compose files
fd -e yaml -e yml | rg -i "docker-compose|compose"

# Then search for timing-related configurations in all compose files
echo -e "\nSearching for timing patterns in compose files:"
fd -e yaml -e yml | rg -i "docker-compose|compose" | xargs rg -A 2 "sleep|delay|timeout"

# Look for any startup documentation in the codebase
echo -e "\nSearching for startup documentation:"
rg -i "startup|boot|wait|timing" -g "!*.{pyc,so,o}" -g "!{build,dist,node_modules}/*"

Length of output: 18216

@asamluka asamluka added this to the Sprint 04 2025-01-13 milestone Dec 18, 2024
Copy link
Collaborator

@Zelberor Zelberor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@asamluka asamluka merged commit 908df4f into main Dec 18, 2024
4 checks passed
@asamluka asamluka deleted the 586-feature-start-rqt_console-on-compose-up-of-devroute branch December 18, 2024 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
system System Engineering
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

[Feature]: Start rqt_console on compose up of devroute
2 participants